<template>
<div class="h-100">
    <div class="orderTo " style="overflow:auto;height:7.8rem" v-if="flag">
       <div v-for="item in orderlist" :key='item.orderid'>
            <div >
                <li class="d-flex items-c f-14 e3 p-l ">订单编号：<span class="f-12" >{{item.orderid.slice(19)}}</span><i class="f-1 d-flex jc-end p-r red">等待付款</i></li>
                 <div class="p-all m-all d-flex jc-between items-c">
                     <div>
                     <img :src="v.imgURL" alt="" v-for="v in item.data" :key='v.kindid' class="m-all">
                    </div>
                     <div><span>去付款</span><span>总计{{item.data.length}}件 共￥{{item.price}}</span></div>
                </div>
            </div>
       </div>
    </div>
     <order-null v-else></order-null>
</div>
</template>

<script>
import { orderFind } from '@/utils/api'
export default {
  data () {
    return {
      orderlist: [],
      flag: false
    }
  },

  created () {
    let userid = localStorage.getItem('userid')
    orderFind({ userid: userid, status: 1 }).then(res => {
      if (res.data.length === !0) {
        this.flag = true
        this.orderlist = res.data
      } else {
        this.flag = false
      }
      // console.log(res.data)
    })
  }
}
</script>
